<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>节奏大师</title>
	<meta name="x-id" content="1036">
	<meta name="x-share-desc" content="节奏大师最摇摆！跟着音乐节奏一起动起来！" data-custom="合着音乐节拍，轻松斩获{s}分，新一代节奏大师非我莫属！">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="full-screen" content="yes"/>
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true"/>
    <meta name="360-fullscreen" content="true"/>
    <script src="jquery.min.js" language="JavaScript"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <style>
        body, canvas, div {
            -moz-user-select: none;
            -webkit-user-select: none;
            -ms-user-select: none;
            -khtml-user-select: none;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }
		#toolbar{
			position:absolute;
			bottom:3%;
			left:10%;
			width:80%;
			z-index:99;
			display:none;
			text-align:center;
		}
		#toolbar img{
			width:40%;
		}
    </style>

</head>
<body style="padding:0; margin: 0; background: #000;">
<div id="toolbar">
	<img  src="share.png" id="share" ontouchstart="dp_share();"/>
	<img  src="more.png" id="more" ontouchstart="clickMore();"/>
</div>
<script src="res/loading.js"></script>
<canvas id="gameCanvas" width="800" height="450"></canvas>

<script cocos src="game.min.js?v2.0"></script>
<script language=javascript>
    window.shareData = {
        "imgUrl": "http://wx.iooook.com/game/jzds/icon.png",
        "timeLineLink": "http://wx.iooook.com/game/jzds/index.html",
        "homeurl":"http://wx.iooook.com/youxi",
        "tTitle": "节奏大师",
        "tContent": "好玩的手指游戏..."
    };
    var url = location.href;
    $.get("http://jianzh5.oicp.net/WeiXin/SDKAction/JsBridge",{url:url},function(data){
        wx.config({
            debug : true,
            appId : data.appId,
            timestamp : data.timestamp,
            nonceStr: data.nonceStr,
            signature: data.signature,
            jsApiList : [
                "onMenuShareTimeline",
                "onMenuShareAppMessage"
            ]
        });
    })
    function goHome(){
        window.location = window.shareData.timeLineLink;
    }
    function clickMore(){
         window.location = window.shareData.homeurl;
    }
    function dp_share(){
        wx.ready(function (){
            wx.onMenuShareTimeline({
                title: window.shareData.tTitle, // 分享标题
                link: window.shareData.timeLineLink, // 分享链接
                imgUrl: window.shareData.imgUrl, // 分享图标
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });
            wx.onMenuShareAppMessage({
                title: window.shareData.tTitle, // 分享标题
                desc: window.shareData.tContent, // 分享描述
                link: window.shareData.timeLineLink, // 分享链接
                imgUrl: window.shareData.imgUrl, // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });
        });

        wx.error(function(res){
            alert(res);
        });
       // alert("hello:"+window.shareData.tTitle);
       //document.getElementById("shareIcon").style.display="";

    }
    function dp_Ranking(){
        //window.location=game9g.homeurl;
    }

    function showAd(){
    }
    function hideAd(){
    }
    function dp_submitScore(score){
        if(score>0){
            window.shareData.tTitle = shareTitle(score);
            window.shareData.tContent = "节奏大师，最好玩的指尖游戏";
        }
    }
    function shareTitle(score) {
        var title="我在#节奏大师#玩了" + score + "分，动次打次，跟我一起嗨起来~";;
        switch(true){
            case score > 8000 :
                title = "我在#节奏大师#玩了" + score + "分，我为完美代言！";
                break;
            case score > 6500 :
                title = "我在#节奏大师#玩了" + score + "分，精准地打着节拍！人称“节奏大师”";
                break;
            case score > 5500 :
                title = "我在#节奏大师#玩了" + score + "分，人称“节奏高手”";
                break;
            case score > 3000 :
                title = "我在#节奏大师#玩了" + score + "分，人称“节奏菜鸟”";
                break;
            case score > 1500 :
                title = "我在#节奏大师#玩了" + score + "分，动次打次，跟我一起嗨起来~";
                break;
            case score > 0 :
                title = "我在#节奏大师#玩了" + score + "分，这音乐真带感！";
                break;
            default: title = "#节奏大师#把握最强的音乐节奏，随着音乐的旋律嗨起来！";
        }
        return title+"";
    };

</script>
	
</body>
</html>